<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <form action="post">
    <p>
      <span>用户名</span>
      <input type="text" id="user">

    </p>
    <p>
      <span>单选框</span>
      <input type="radio" name="sex" value="boy" id="bo">男
      <input type="radio" name="sex" value="girl" id="gi">女

    </p>
  </form>
  <script>
    var input_ = document.getElementById('user');
    var sexx = document.getElementById('bo')
    var rl = document.getElementById('gi')
    // 对于单选框，多选框等固定的值，sexx.value只能获取到当前的值
    sexx.checked// 如果查看返回结果是否为true，如果为true就是被选择
    sexx.checked = 'true'//可以修改，赋值
    input_.value//得到他的值
    input_.value = 'ascas345'//可以修改input_的值


  </script>
</body>

</html>